Title Banner

Previous Book Contents Book Index Next

Inside Macintosh: OpenDoc Class Reference /
Part 1 - Classes and Methods / ODStorageUnitView


SetPromiseValue

The SetPromiseValue method writes data to the specified value of the focused property, creating the value if it doesn't exist and making the value a promise value.

void SetPromiseValue (in ODValueType valueType,
                      in ODULong offset,
                      in ODByteArray value,
                      in ODPart sourcePart);
valueType
The type of the value where the promise data is to be written.
offset
The offset at which the promise data is to be stored, expressed as an unsigned 32-bit number of bytes from the beginning of the value.
value
A byte array whose buffer contains the promise data to be written.
sourcePart
A reference to the part that made the promise.
DISCUSSION
You call this method to write a promise for a value of the specified type in the focused property. You may call this method multiple times to promise values of different types or to write to different offsets in the same value.

This method writes data to the specified value, starting at the specified offset (inclusive), and overwrites any data at and beyond the offset. If the current offset plus the length of data being written is greater than the current size of the value (as returned by the GetSize method), the size of the value is automatically increased to accommodate the new data.

When you no longer need the structure you pass as the value parameter, you should deallocate that structure and its buffer.

EXCEPTIONS
kODErrIllegalNullValueTypeInput
The specified value type is null.
kODErrInvalidValueType
The specified value type is improperly formed or illegal.
kODErrUnfocusedStorageUnit
The focus context of this storage-unit view is not a property or a value.
If the storage-unit cursor for this storage-unit view does not represent a legal focus context for the storage unit that created this storage-unit view, this method throws exceptions raised by the FocusWithCursor method of that storage unit.

SEE ALSO
The ODByteArray type (page 877).
The ODValueType type (page 904).
The ODStorageUnitView::GetPromiseValue method (page 739).
The ODStorageUnitView::GetSize method (page 742).
The ODStorageUnitView::IsPromiseValue method (page 750).


Previous Book Contents Book Index Next

© Apple Computer, Inc.
17 JUL 1996




Navigation graphic, see text links

Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help